<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MessageInbox>" %>
<%@ Import Namespace="TeamCommunitySolution.Domain.DataLayer.Base"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">

        $(document).ready(function() {
            $("input#ToUser").autocomplete('<%= Url.Action("SearchName", "SystemUser") %>');
        }); 

    </script>

    <h2>
        Create</h2>
    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>
    <% using (Html.BeginForm())
       {
           if (Model != null)
           { %>
           <%= Html.Hidden("UserId", Model.UserFrom.Id) %>
    <%}%>
    <fieldset>
        <legend>Fields</legend>
        <p>
            <label for="ToUser">
                To:</label>
            <%= Html.TextBox("ToUser") %>
            <%= Html.ValidationMessage("ToUser", "*") %>
        </p>
        <p>
            <label for="Title">
                Title:</label>
            <%= Html.TextBox("Title") %>
            <%= Html.ValidationMessage("Title", "*") %>
        </p>
        <p>
            <label for="MessageContent">
                Message Content:</label>
            <%= Html.TextArea("MessageContent", String.Empty, 6, 50, String.Empty)%>
            <%= Html.ValidationMessage("MessageContent", "*") %>
        </p>
        <p>
            <input type="submit" value="CreatePersonalMessage" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>
</asp:Content>
